package com.androidx.p013lv.invention.view;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.InventionBean;
import com.androidx.p013lv.base.bean.VideoBean;
import com.androidx.p013lv.base.listener.ItemClickListener;
import com.androidx.p013lv.base.p015ui.LazyFragment;
import com.androidx.p013lv.base.utils.TimeUtils;
import com.androidx.p013lv.invention.C1069R;
import com.androidx.p013lv.invention.OnInventionType;
import com.androidx.p013lv.invention.adapter.TodayAdapter;

/* renamed from: com.androidx.lv.invention.view.TodayView */
public class TodayView {
    TodayAdapter adapter;
    LinearLayout btn_day_before;
    LinearLayout btn_more;
    Context context;
    String domain;
    Fragment fragment;
    InventionBean inventionBean;
    OnInventionType onInventionType;
    int position;
    RecyclerView recycler;
    TextView tv_content;
    TextView tv_day;
    TextView tv_mouth;
    TextView tv_title;

    public TodayView(View view, Fragment fragment2, String str, OnInventionType onInventionType2) {
        this.context = view.getContext();
        this.onInventionType = onInventionType2;
        this.domain = str;
        this.fragment = fragment2;
        this.tv_title = (TextView) view.findViewById(C1069R.C1072id.tv_title);
        this.btn_more = (LinearLayout) view.findViewById(C1069R.C1072id.btn_more);
        this.tv_content = (TextView) view.findViewById(C1069R.C1072id.tv_content);
        this.recycler = (RecyclerView) view.findViewById(C1069R.C1072id.recycler_view);
        this.btn_day_before = (LinearLayout) view.findViewById(C1069R.C1072id.btn_day_before);
        this.tv_day = (TextView) view.findViewById(C1069R.C1072id.tv_day);
        this.tv_mouth = (TextView) view.findViewById(C1069R.C1072id.tv_mouth);
    }

    public void setView(InventionBean inventionBean2, int i) {
        this.inventionBean = inventionBean2;
        this.position = i;
        try {
            String[] split = TimeUtils.utcToChina2(inventionBean2.getRecAt()).split("-");
            TextView textView = this.tv_day;
            textView.setText(split[1] + "");
            TextView textView2 = this.tv_mouth;
            textView2.setText("  / " + split[0]);
        } catch (Exception e) {
            e.printStackTrace();
            this.tv_day.setText("");
            this.tv_mouth.setText("");
        }
        this.btn_more.setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.invention.view.TodayView.View$OnClickListenerC11901 */

            public void onClick(View view) {
                TodayView.this.onInventionType.onClick(TodayView.this.inventionBean, TodayView.this.position, view.getId());
            }
        });
        this.btn_day_before.setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.invention.view.TodayView.View$OnClickListenerC11912 */

            public void onClick(View view) {
                TodayView.this.onInventionType.onClick(TodayView.this.inventionBean, TodayView.this.position, view.getId());
            }
        });
        this.recycler.setLayoutManager(new LinearLayoutManager(this.context, 0, false));
        TodayAdapter todayAdapter = new TodayAdapter(inventionBean2.getDailyRecResList(), this.domain, this.fragment);
        this.adapter = todayAdapter;
        this.recycler.setAdapter(todayAdapter);
        this.adapter.setItemListener(new ItemClickListener() {
            /* class com.androidx.p013lv.invention.view.TodayView.C11923 */

            @Override // com.androidx.p013lv.base.listener.ItemClickListener
            public void onItemClick(View view, int i) {
                ((LazyFragment) TodayView.this.fragment).startVideoPlay(((VideoBean) TodayView.this.adapter.getDataInPosition(i)).getVideoId());
            }
        });
    }
}
